# Replication Package
## "What drives climate policy adoption in the U.S. states?"
### Samuel Trachtman — *Energy Policy* 138 (2020) 111214

---

## Overview

This package contains the data and code needed to replicate the key figures and regression tables in the published paper. Running `code/replication.R` produces:

- **Figures A1–A4** (Appendix): Policy trends by presidential voting pattern
- **Table 1**: Summary statistics
- **Tables 2–5**: Regression results for RPS, DG, ACEEE, and severance tax

---

## Requirements

**Software:** R (version 4.0 or later recommended)

**R packages** (install with `install.packages(...)` if needed):

| Package | Use |
|---|---|
| `readxl` | Load data files |
| `dplyr` | Data manipulation |
| `ggplot2` | Figures |
| `plm` | Panel fixed-effects models |
| `lme4` | Multilevel models |
| `arm` | Display multilevel model results |
| `lmtest` | Coefficient tests |
| `sandwich` | Clustered standard errors |
| `stargazer` | Regression tables |

Install all at once:
```r
install.packages(c("readxl", "dplyr", "ggplot2", "plm", "lme4",
                   "arm", "lmtest", "sandwich", "stargazer"))
```

---

## File Structure

```
replication/
├── README.md                   # This file
├── code/
│   └── replication.R           # Main replication script
├── data/
│   ├── party_control/
│   │   └── cleaned_pty_control.xlsx      # State legislative/gov party control
│   └── policy/
│       ├── covariates.xlsx               # State-level economic/demographic covariates
│       ├── aceee/
│       │   └── cleaned_aceee.xlsx        # ACEEE energy efficiency scores
│       ├── free_the_grid/
│       │   └── cleaned_ftg.xlsx          # Freeing the Grid DG policy scores
│       ├── pricing/
│       │   └── cleaned_pricing.xlsx      # Carbon pricing/trading programs
│       ├── rps/
│       │   ├── rps_data_cleaned.xlsx     # Renewable portfolio standard stringency
│       │   ├── cleaned_state_gen.xlsx    # State-level electricity generation
│       │   ├── adaptation.xlsx           # Climate adaptation plans
│       │   └── gas_tax.xlsx              # State gas tax data
│       └── severance/
│           └── cleaned_sev.xlsx          # Oil and gas severance tax rates
└── figures/                    # Output directory (created on first run)
```

---

## How to Run

1. Open `code/replication.R` in RStudio
2. The script sets the working directory automatically when run from RStudio. If running from the command line, set the working directory manually at the top of the script:
   ```r
   setwd("/path/to/replication")
   ```
3. Run the script. Figures are saved as `.png` files to the `figures/` directory. Regression tables are printed to the console in text format.

**To produce LaTeX-formatted tables** (e.g. for Overleaf), change `type = "text"` to `type = "latex"` in each `stargazer()` call.

---

## Data Sources

| Dataset | Source | Coverage |
|---|---|---|
| RPS stringency | Carley et al. (2018) | 2000–2014 |
| Freeing the Grid (DG policy) | Vote Solar / NRDC | 2007–2018 |
| ACEEE energy efficiency scores | ACEEE State Scorecard | 2007–2017 |
| Severance tax rates | Weber et al. (2016) | 2004–2013 |
| Carbon pricing programs | Compiled by author | 2000–2018 |
| State electricity generation | U.S. Energy Information Administration | 2000–2018 |
| Party control of government | Compiled by author | 2000–2018 |
| State covariates (GDP, unemployment, etc.) | BEA, BLS, Census | 2000–2018 |

---

## Outputs

### Figures (saved to `figures/`)

| File | Description | Corresponds to |
|---|---|---|
| `fig_a1_rps.png` | RPS policy strength by presidential voting, 2000–2014 | Fig. A1 |
| `fig_a2_dg.png` | DG policy strength by presidential voting, 2007–2018 | Fig. A2 |
| `fig_a3_aceee.png` | Energy efficiency by presidential voting, 2007–2017 | Fig. A3 |
| `fig_a4_sev.png` | Severance tax by presidential voting, 2004–2013 | Fig. A4 |

### Tables (printed to console)

| Label | Description | Corresponds to |
|---|---|---|
| Table 1 | Summary statistics | Table 1 |
| Table 2 | Predictors of RPS strength | Table 2 |
| Table 3 | Predictors of DG policy strength | Table 3 |
| Table 4 | Predictors of ACEEE energy efficiency score | Table 4 |
| Table 5 | Predictors of severance tax rate | Table 5 |

Each regression table has three columns: (1) two-way fixed effects, political variables only; (2) two-way fixed effects with economic controls; (3) multilevel model with state-level covariates.

---

## Citation

Trachtman, Samuel. 2020. "What drives climate policy adoption in the U.S. states?" *Energy Policy* 138: 111214. https://doi.org/10.1016/j.enpol.2019.111214
